<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="/">
		<html>
			<head>
				<title>商品信息列表</title>
			</head>
			<body>
				<h2 style="text-align: center;">
					商品信息列表
				</h2>
				<xsl:apply-templates select="products" />
			</body>
		</html>
	</xsl:template>
	<xsl:template match="products">
		<table border="1px" cellpadding="20px" cellspacing="0" align="center">
			<tr>
				<th>商品名称</th>
				<th>商品价格</th>
				<th>商品缩略图</th>
				<th>商品类别</th>
			</tr>
			<xsl:for-each select="product" >
				<xsl:sort data-type="number" select="price" />
					<tr>
					<td><xsl:value-of select="name" /></td>
					<td><xsl:value-of select="price" /></td>
					<td>
						<img width="100px" height="100px">
							<xsl:attribute name="src">
								<xsl:value-of select="thumbnail" />
							</xsl:attribute>
						</img>
					</td>
					<td><xsl:value-of select="categoryid" /></td>
					</tr>
			</xsl:for-each>
		</table>
	</xsl:template>
</xsl:stylesheet>